home *** CD-ROM | disk | FTP | other *** search
- From: cons@mercury.cern.ch (Lionel Cons)
- Newsgroups: alt.security
- Subject: X Lack of Security
- Message-ID: <CONS.92Mar24173517@mercury.cern.ch>
- Date: 24 Mar 92 16:35:17 GMT
- Organization: CERN, European Research Center for Particle Physics
-
- X is not secure, how can we live with it ?
-
- Few days ago I've asked the following questions (in comp.windows.x):
-
- > 1) How can I prevent a user from machine 'foo' to access the display
- > 'foo:0'? By accessing I mean run a program that will open a connection
- > to that display.
- >
- > 2) How can I allow someone from machine 'bar' to access the display
- > 'foo:0' without allowing it for EVERYBODY from machine 'bar'? In other
- > words, is there a way to control display access without using xhost?
- >
- > 3) How can I have the list of all the clients (even without window)
- > connected to my display? I'd like to have many informations like:
- > machine where the client run, user id of the remote process...
-
- Here are some ideas:
-
- There are two security mechanisms in X: xhost and xauth.
-
- - xhost only allows a per machine control, this implies that:
- * all users of machine A can run xhost to modify the access list for
- display A:0 and do what they want, it is a big problem when the
- machines use the Yellow Pages: all users can log into all machines...
- * you can't allow a user from machine B to access display A:0 without
- allowing ALL users from machine B to access A:0.
- The man page says:
- The xhost program is used to add and delete hosts to the list of
- machines that are allowed to make connections to the X server. This
- provides a rudimentary form of privacy control and security. It is
- only sufficient for a workstation (single user) environment, although
- it does limit the worst abuses. Environments which require more
- sophisticated measures should use the hooks in the protocol for
- passing authentication data to the server.
-
- - xauth allows a per user control, it is not in X11R3 distribution. This it
- how it works (at least on my machine):
- * you must start the server with the -auth option
- * a 'magic cookie' is created
- * to allow a user to access the display you must give him the cookie
- with xauth.
- The man page (for Xserver) says:
- The sample server implements a simplistic authorization protocol,
- MIT-MAGIC-COOKIE-1 which uses data private to authorized clients and
- the server. This is a rather trivial scheme; if the client passes
- authorization data which is the same as the server has, it is allowed
- access. This scheme is worse than the host-based access control
- mechanisms in environments with unsecure networks as it allows any
- host to connect, given that it has discovered the private key. But in
- many environments, this level of security is better than the host-
- based scheme as it allows access control per-user instead of per-host.
-
- The 2 mechanisms can run together, if so the protection is minimum (i.e. the
- connection is accepted if one of the 2 mechanisms accept it).
-
- Here are some answers:
-
- 1) There is no way of preventing a user from machine A to access the display A:0.
- The user can always use xhost (unless the owner and modes are not standard but
- the user can use its own copy...).
-
- 2) Use the xauth mechanism and hope that nobody will steal your cookies...
-
- 3) If you want to list clients WITH windows use xlsclients.
- If you want to list clients WITHOUT windows use netstat -a and look for
- connection to the X server (for instance TCP on port 6000).
-
- Conclusion: X is not secure, when you type something in a window you can be sure
- that someone can read it... Big Brother and Little Hacker are watching you...
-
- Thanks to all who responded: Roland Zink, Dipankar Gupta and George D M Ross.
- --
-
- Lionel Cons
-
- +------- CERN - European Laboratory for Particle Physics -------+
- | E-mail: cons@dxcern.cern.ch |
- | Earth-mail: CN/SW/WS, CERN, CH-1211 GENEVE 23, Switzerland |
- | Phone: + 41 22 767 2370 |
- +---------------------------------------------------------------+
-
-